package com.hcyy.service.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hcyy.dao.ProductDao;
import com.hcyy.entity.Product;
import com.hcyy.service.ProductService;

@Service
@Transactional
public class ProductServiceImpl implements ProductService {

	@Autowired
	private ProductDao productDao;
	
	@Override
	public List<Product> showProduct(String dwbh,Integer sjid,Integer khlb) {
		return productDao.findAllProducts(dwbh,sjid,khlb);
	}

	public Product findProductById(String spid,Integer sjid){
		return productDao.findProductById(spid,sjid);
	}

	@Override
	public List<Product> findProductBySearch(String search,String dwbh,Integer sjid,Integer khlb) {
		return productDao.findProductBySearch(search,dwbh,sjid,khlb);
	}

	@Override
	public List<Product> findProduct4Index(String dwbh,Integer tejia,Integer sjid,Integer khlb) {
		return productDao.findProduct4Index(dwbh,tejia,sjid,khlb);
	}

	@Override
	public List<Product> findProductPage(Integer offset, Integer size,String dwbh,Integer tejia,Integer sjid,Integer khlb) {
		return productDao.findProductPage(offset, size,dwbh,tejia,sjid,khlb);
	}

	@Override
	public List<Product> findProductByLeibie(String dwbh,Integer flbid,Integer sjid,Integer khlb,Integer offset,Integer size) {
		return productDao.findProductByLeibie(dwbh,flbid,sjid,khlb, offset, size);
	}

	
}
